package com.ccl.iot.object;

public class IOTDeviceInfoEx {

	public long iID = 0;
	public int iType = 0;
	public int iModel = 0;
	public long iVersion = 0;
	public long iRegisterSpace = 0;
	
	public IOTDeviceInfoEx(){
	}
	
	public IOTDeviceInfoEx(int aType, int aModel, long aVersion, long aRegisterSpace){
		iType = aType;
		iModel = aModel;
		iVersion = aVersion;
		iRegisterSpace = aRegisterSpace;
	}
	
	public IOTDeviceInfoEx(long aID, int aType, int aModel, long aVersion, long aRegisterSpace){
		this(aType, aModel, aVersion, aRegisterSpace);
		
		iID = aID;
	}
	
	@Override
	public String toString() {
		return iID + ":" + iType + "-" + iModel + "." + iVersion + "[" + iRegisterSpace + "]";
	}
	
	@Override
	public boolean equals(Object o) {
		if (o != null && o instanceof IOTDeviceInfoEx){
			IOTDeviceInfoEx tInfo = (IOTDeviceInfoEx) o;
			
			return tInfo.iID == iID && tInfo.iType == iType && tInfo.iModel == iModel && tInfo.iVersion == iVersion && tInfo.iRegisterSpace == iRegisterSpace;
		}else{
			return super.equals(o);
		}
	}
	
}
